# -*- python -*-
#:kivy 1.0

#:set spinbox_white 1, 1, 1, 1
#:set spinbox_black 0, 0, 0, 1
#:set spinbox_transp 0, 0, 0, 0

<SpinBox>:
    txtinput: _txtinput
    height: int(_txtinput.line_height*2)
    background_color: 1, 1, 1, 1
    up_button_icon_src: 'atlas://data/images/defaulttheme/tree_opened'
    canvas:
        Color:
            rgba: spinbox_white if self.pressed == 'down' else spinbox_transp
        Rectangle:
            size: root.button_height, root.button_height
            pos: self.right - root.button_width, self.y
        Color:
            rgba: self.background_color if self.pressed != 'down' else spinbox_black            
        Rectangle:
            source: self.up_button_icon_src
            size: root.button_height, root.button_height
            pos: self.right - root.button_width, self.y

        Color:
            rgba: spinbox_white if self.pressed == 'up' else spinbox_transp
        Rectangle:
            size: root.button_width, root.button_height
            pos: self.right - root.button_width, self.y+root.button_height
        Color:
            rgba: self.background_color if self.pressed != 'up' else spinbox_black                                    
        Rectangle:
            source: self.up_button_icon_src
            size: root.button_width,- root.button_height
            pos: self.right - root.button_width, self.y+2*root.button_height
    NumericInput:
        id: _txtinput
        integer: root.integer
        pos: root.pos
        height: root.button_height*2
        width: root.width-root.button_width
        multiline: False
